﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WebControl_UpdateBusticket : System.Web.UI.UserControl
{
    private string getidbus = null;
    private string getamount = null;
    private string getstatus = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            getidbus = Request.QueryString["idbus"].ToString();
            getamount = Request.QueryString["amount"].ToString();
            getstatus = Request.QueryString["status"].ToString();
            int idbus = Convert.ToInt32(getidbus);
            txtamount.Text = getamount;
            DropDownList1.SelectedValue = getstatus;
        }               
    }
    protected void Button1_Click1(object sender, EventArgs e)
    {
            ListAndProcessData wsv = new ListAndProcessData();
            getidbus = Request.QueryString["idbus"].ToString();
            int idbus = Convert.ToInt32(getidbus);
            int amount = Convert.ToInt32(txtamount.Text);
            string status = DropDownList1.SelectedValue;
            bool check = wsv.UpdateBusticket(idbus, amount, status);
            if (check)
            {
                Response.Redirect("ShowBusticket_Admin.aspx");

            }
            else
            {
                Response.Redirect("Loi.aspx");
            }
       
    }

    
}